bpo-38565: add new cache_parameters method for lru_cache#16916
bpo-38565: add new cache_parameters method for lru_cache#16916rhettinger merged 6 commits intopython:masterfrom
Conversation
Lib/functools.py
Outdated
There was a problem hiding this comment.
NIt: Please use single quotes, the same as used by dict.__repr__()
There was a problem hiding this comment.
Also move the function to just after cache_clear().
Lib/test/test_functools.py
Outdated
There was a problem hiding this comment.
Let's use the decorator notation to create the example. Also, make the example use maxsize=1000 and typed=True.
There was a problem hiding this comment.
``Add new cache_parameters() method for functools.lru_cache() to better support pickling.
Modules/_functoolsmodule.c
Outdated
There was a problem hiding this comment.
Need to test whether cache_parameters is NULL.
Modules/_functoolsmodule.c
Outdated
There was a problem hiding this comment.
There are also two possible failure points that need to be tested here as well.
Modules/_functoolsmodule.c
Outdated
There was a problem hiding this comment.
- Drop the test for zero, putting the positive case first:
self->typed ? Py_True : Py_False) - Test the result of PyDict_SetItemString() to see if it failed.
Modules/_functoolsmodule.c
Outdated
There was a problem hiding this comment.
Move this down one, just after the cache_clear entry.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
8354f2d to
37f4f0d
Compare
… support pickling
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @rhettinger: please review the changes made to this pull request. |
|
ping @rhettinger |
https://bugs.python.org/issue38565
https://bugs.python.org/issue38565